package cn.iocoder.yudao.module.mqtt.dal.mysql.user;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.mqtt.dal.dataobject.user.MedicalUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mqtt.controller.admin.user.vo.*;

/**
 * 用户信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface MedicalUserMapper extends BaseMapperX<MedicalUserDO> {

    default PageResult<MedicalUserDO> selectPage(MedicalUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MedicalUserDO>()
                .eqIfPresent(MedicalUserDO::getPackageId, reqVO.getPackageId())
                .eqIfPresent(MedicalUserDO::getMobile, reqVO.getMobile())
                .eqIfPresent(MedicalUserDO::getVerificationCode, reqVO.getVerificationCode())
                .betweenIfPresent(MedicalUserDO::getVerificationCodeTime, reqVO.getVerificationCodeTime())
                .likeIfPresent(MedicalUserDO::getUsername, reqVO.getUsername())
                .betweenIfPresent(MedicalUserDO::getPeriodTime, reqVO.getPeriodTime())
                .eqIfPresent(MedicalUserDO::getSex, reqVO.getSex())
                .eqIfPresent(MedicalUserDO::getPassword, reqVO.getPassword())
                .likeIfPresent(MedicalUserDO::getNickname, reqVO.getNickname())
                .eqIfPresent(MedicalUserDO::getRemark, reqVO.getRemark())
                .eqIfPresent(MedicalUserDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(MedicalUserDO::getStatus, reqVO.getStatus())
                .eqIfPresent(MedicalUserDO::getLoginIp, reqVO.getLoginIp())
                .betweenIfPresent(MedicalUserDO::getLoginDate, reqVO.getLoginDate())
                .betweenIfPresent(MedicalUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MedicalUserDO::getId));
    }

}